'''分析youtube1000的数据
制出各自的评论数量的直方图

'''

import numpy as np
from matplotlib import pyplot as plt

us_file_path = './youtube_video_data/US_video_data_numbers.csv'
uk_file_path = './youtube_video_data/GB_video_data_numbers.csv'

t_us = np.loadtxt(us_file_path,delimiter=',',dtype='int')
print(t_us)
# [4394029  320053    5931   46245]
# 观看数     喜欢数            评论数

t_us_comments = t_us[:,-1]
print(t_us_comments)
t_us_comments = t_us_comments[t_us_comments<5000]

d = 50
bin_nums = (np.max(t_us_comments)-np.min(t_us_comments))//d


plt.figure(figsize=(20,8), dpi=80)
plt.hist(t_us_comments,bin_nums)
plt.show()



